import {
  LengthTool,
  RectangleROITool,
  ToolGroupManager,
  Enums as csToolsEnums,
  annotation,
  addTool,
} from '@cornerstonejs/tools';
import {Enums, init as csRenderInit, RenderingEngine, getRenderingEngine} from "@cornerstonejs/core";
const { selection, visibility } = annotation;

export function addButtonToToolbar({ id, title, container, onClick }) {
  const annotationUIDs = selection.getAnnotationsSelected();
  console.log(annotationUIDs)
  if (annotationUIDs && annotationUIDs.length){
      const annotationUID = annotationUIDs[0];
      visibility.setAnnotationVisibility(annotationUID, false);
      const renderingEngine = getRenderingEngine("myRenderingEngine");
      renderingEngine.renderViewports(["CT_STACK"]);
  }
}
